import com.hubu.map.HashMap;

import java.util.LinkedHashMap;

public class HashSet <K>{
    private static final Object VALUE=new Object();
    private HashMap<K,Object> map=new HashMap<>();
    public boolean add(K data){
        Object result = map.put(data, VALUE);
        return result==null?true:false;
    }
    public boolean contains(K data){
        return map.get(data)!=null;
    }
    public boolean remove(K data){
        Object result = map.remove(data);
        return result!=null?true:false;
    }
    public int size(){
        return map.size();
    }
    public boolean isEmpty(){
        return map.isEmpty();
    }
}
